/*
 * Plug.h
 *
 *  Created on: 2014-4-27
 *      Author: song
 */

#ifndef PLUG_H_
#define PLUG_H_
#include "cmd.h"
#include "types.h"
#include "UdpSocket.h"
#include "TcpServer.h"
#include <pthread.h>


class Plug {
public:
	Plug();
	virtual ~Plug();

	UdpSocket *m_pUdpSocket;
	TcpServer *m_pTcpServer;
	struct sockaddr_in  m_addr_remote;

public:

	void StopWork();
	void StartWork();
	MWifiMode GetWifiMode();
	MWifiMode SetWifiMode(MWifiMode mode);

	pthread_t m_pthreadHeartBeat;
	pthread_t m_pthreadUdpRec;


	bool SetOffRelay();
	bool SetOnRelay();
	bool GetRelayStatus();
	uint16 GetCur();
};

#endif /* PLUG_H_ */
